import { z } from "zod";

const userStatusSchema = z.union([z.string("normal"), z.string("disabled")]);
export type UserStatus = z.infer<typeof userStatusSchema>;

const userSchema = z.object({
  id: z.number(),
  username: z.string(),
  nickname: z.string(),
  email: z.string(),
  mobile: z.string(),
  status_cn: userStatusSchema,
  roles: z.string(),
  createdAt: z.coerce.date(),
  updatedAt: z.coerce.date(),
});
export type Admin = z.infer<typeof userSchema>;

export const adminListSchema = z.array(userSchema);
